
/************提交数据**********/
mui(".mui-content").on('tap','.cxBtn',function(){
	var myreg=/^[1][3,4,5,7,8][0-9]{9}$/
	var phone=$(".cxInput").val()
	if(!phone||!myreg.test(phone))
	{
		outLine('手机号码有误')
		return false
	}
	var getlawdata={
		title:"提交法律咨询",
		url:"index/listlaw",
		fromwho:'lj',
		sendData:{
		    type:'',
			phone:phone
		}
	}
	getAjax(uplawdata,
		function(data){
			setLawQueryData(data)
		},
		function(data){
			setLawQueryData(data)
		}
	)
})
/************提交数据end**********/
function setLawQueryData(data){
	var data=[
		{
		    "id": 1,
		    "username": "孙悟空",
		    "type": "类型",
		    "date": 1512108352000,
		    "headimage": "./img/t.jpg",
		    "content": "水果摊缺斤少两应该找谁呢？",
		    "anwser": "你可以到消费者协会进行举报，或者拨打12315"
		 },
		 {
		    "id": 2,
		    "username": "孙悟饭",
		    "type": "类型",
		    "date": 1512108352000,
		    "headimage": "./img/t.jpg",
		    "content": "水果摊缺斤少两应该找谁呢？",
		    "anwser": ""	
		 }
	]
	var html=''
	$.each(data,(k,v)=>{
		var time=timeDate(v.date)
		html+=`
			<p class="zt">状态:${v.anwser ? '已回复' : '等待回复'}&nbsp;&nbsp;&nbsp;时间:${time}</p>
			<p class="zxnr">
				您的咨询内容：<br />
				<span>${v.content}</span>
			</p>`
		if(v.anwser){
			html+=`
				<p class="hfnr">
					回复内容：<br />
					<span>${v.anwser}</span>
				</p>
			`
		}
	})
	$('.cxjg').html(html)
}